package thread;

public class ThreadDemo4 {
    public static void main(String[] args) {
        Thread t=new MyThread();
        Runnable r=new MyRunnable();

        Thread t1=new Thread(r);
        t.start();
        t1.start();
    }
}
class MyRunnable implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("你是谁啊？");
        }
    }
}
class MyThread extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("开门，查水表的");
        }
    }
}
